package com.dabai.iot.core.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dabai.common.tenant.core.TenantEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 服务端订阅表 实体类
 *
 * @author kev1n
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("iot_server_subscribe")
public class ServerSubscribeEntity extends TenantEntity {

    /**
     * 主键id
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 产品id
     */
    @Schema(description = "产品id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long productId;

    /**
     * 推送消息类型
     */
    @Schema(description = "推送消息类型")
    private String messageType;

    /**
     * 删除标志（0代表存在 1代表删除）
     */
    @TableLogic
    private String delFlag;

}
